﻿//-----------------------------------------------------------------
//
// @(#)$Id: Dispute.cs,v 1.0 2014/01/07 10:14:22 lichunhua Exp $
// @(#)$Author: lichunhua  $
// @(#)$Date: 2014/01/07 10:14:22 $
// @(#)$Description:
//
//
//
//                 All Rights Reserved.
//-----------------------------------------------------------------
using System;
using System.Data;
using System.Data.SqlClient;

namespace ebay.Dal
{
  public class Dispute {
    public DataTable GetDisputeDetail(String eBayUserID, String caseID) {
        String sqlString = "SELECT c.CreationDate,c.Amount,NULL AS Refund,c.CaseType,c.CaseStatusValue,d.Decision,d.DecisionDate FROM eBayUserCase c LEFT JOIN eBayUserCaseDetail d ON c.eBayUserID=d.eBayUserID AND c.CaseID=d.CaseID WHERE c.eBayUserID=@eBayUserID AND c.CaseID=@CaseID";
      SqlParameter[] parameters = new SqlParameter[] {
        new SqlParameter() { ParameterName = "@eBayUserID", SqlDbType = SqlDbType.NVarChar, Size = 80, Value = eBayUserID },
        new SqlParameter() { ParameterName = "@CaseID", SqlDbType = SqlDbType.NVarChar, Size = 30, Value = caseID }
      };

      return SqlHelper.ExecuteDataTable(SqlHelper.ceterDB_Conn, CommandType.Text, sqlString, parameters);
    }
  }
}
